package com.kiliter.utils;

import cn.hutool.core.date.ChineseDate;
import cn.hutool.core.date.chinese.ChineseMonth;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @ClassName zhangjl
 * @date 2021/6/1 14:45
 * @Version 1.0
 */
public class TimeUtils {
    public static String getTime(){
        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
        return format;
    }

    public static String getChineseDay(Date date){
        ChineseDate chineseDate = new ChineseDate(date);
        int month = chineseDate.getMonth();
        int day = chineseDate.getDay();
        String str =forMate(month)+"-" +forMate(day);
        return str;
    }

    private static String forMate(Integer integer){
        return integer>=10?integer+"":"0"+integer;
    }
}
